<template>
  <el-container style="background-image: url('../../static/assets/bg.png');">
    <el-header class="header" style="height: 100px;">
      <div class="main-logo">
        <img class="logo" src="../../static/assets/logo.png" alt=""><span class="logo-title">&nbsp;&nbsp;BookMall</span>
      </div>
      <div class="main-nav">
        <el-link href="#">首页</el-link>
        <!-- <el-link v-for="parent in parentMenu[1].children" :href="parent.path" :key="parent.id">{{parent.menuName}}</el-link> -->
        <!-- <el-link href="#/buildingmanagement">信息管理</el-link>
        <el-link href="#/housemanagement">房屋管理</el-link>
        <el-link href="#/ownermanagement">业主管理</el-link> -->
      </div>
      <div class="main-user-message">
        <div style="display:flex; justify-content: flex-end;">
          <span>
            欢迎您，
          </span>
          <el-dropdown trigger="click" placement="top-end">
            <span class="el-dropdown-link">
              <el-avatar shape="circle" :size="70" :src="iconPath" style="margin: 15px 5px 0 !important;"></el-avatar>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item><el-link :underline="false" type="success" href="#"></el-link></el-dropdown-item>
              <el-dropdown-item><el-link :underline="false" type="success"
                  href="#/uploadavatar">头像上传</el-link></el-dropdown-item>
              <el-dropdown-item><el-link :underline="false" type="success" href="#">密码修改</el-link></el-dropdown-item>
              <el-dropdown-item><el-link :underline="false" type="success"
                  href="#/login">退出</el-link></el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
      </div>
    </el-header>
    <el-container>
      <el-aside style="width: 30%; height: 100vh; background-color:rgba(254, 200, 135,0.9);">
        <el-menu class="el-menu-vertical-demo" background-color="transparent" text-color="#4a5e84"
          active-text-color="#678E81">
          <!-- <el-submenu v-for="parent in parentMenu" :index="parent.id.toString()" :key="parent.id">
            <template slot="title">
              <i class="el-icon-s-operation"></i>
              <span>{{parent.menuName}}</span>
            </template>
            <el-menu-item v-for="child in parent.children" :index="child.id.toString()" :key="child.id">
              <el-link :underline="false" :href="child.path">{{child.menuName}}</el-link>
            </el-menu-item>
          </el-submenu> -->
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-s-operation"></i>
              <span>系统管理</span>
            </template>
            <el-menu-item index="2">
              <el-link :underline="false" href="#/accountmanagement">账号管理</el-link>
            </el-menu-item>
            <el-menu-item index="2">
              <el-link :underline="false" href="#/booktypemanagement">书籍类别管理</el-link>
            </el-menu-item>
          </el-submenu>

        </el-menu>
      </el-aside>
      <el-main style="background-color:#f3be7e; border-left: 1px solid #f3be7e;">
        <router-view />
      </el-main>
    </el-container>

  </el-container>


</template>

<script>
export default {
    name:'NavBar'
    ,data(){
      return{
          iconPath: '@/static/assets/favicon.png'
          ,parentMenu:[

          ]
          ,childMenu:[

          ]
      }
    }
    ,methods:{
      loadMenu(){
        this.$http.get("/menu/loadMenu",{
          params:{

          }
        }).then(res=>{

        })
      }
      ,loadAvatar(){

      }
    }
    ,created(){

    }
}
</script>

<style scoped>
.menu {
  position: relative;
  top: -100px; /* Assuming this is for positioning, adjust if needed */
}

.main ul { /* Changed li to ul for proper nesting */
  list-style: none;
}

.header {
  width: 100%;
  padding-right: 30px;
  display: block;
  background-color: #c99759;
}

.header .main-logo {
  float: left;
  width: 360px;
  height: 100px;
  line-height: 100px;
  text-align: left;
}

.header .main-logo .logo {
  height: 70px;
  margin-top: 8px;
}

.header .main-logo .logo-title {
  vertical-align: 30%;
  font-size: 20px;
  margin-left: 10px;
}

.header .main-nav {
  float: left;
  overflow: hidden;
  height: 100%;
  line-height: 100px;
}

.header .main-nav > li {
  height: 100%;
  float: left;
  font-size: 14px;
  width: 115px;
  cursor: pointer;
}

.header .main-user-message {
  float: right;
  height: 100%;
  line-height: 100px;
}

.header .main-user-message .user {
  cursor: pointer;
}

.header .main-user-message .user:hover {
  color: green;
}

.header .main-user-message .ivu-icon-md-person {
  float: left;
  height: 100%;
  line-height: 100px;
  padding-right: 10px;
  font-size: 18px;
  cursor: pointer;
}

.header .main-user-message .ivu-dropdown {
  text-align: center;
  font-weight: 600;
  height: 100%;
  float: left;
}

.header .main-user-message .ivu-dropdown .ivu-dropdown-rel > a {
  height: 100%;
  line-height: 100px;
  display: block;
}

.header .main-user-message .ivu-dropdown a {
  color: #495060;
}

</style>